package com.czxy.demo13;

import java.util.ArrayList;

public class Test01 {

    public static void main(String[] args) {

        Employee emp01=new Employee("小明",1800);
        Employee emp02=new Employee("小新",2600);

        ArrayList<Employee>list=new ArrayList<>();
        list.add(emp01);
        list.add(emp02);
        for (Employee employee : list) {
            if (employee.getName().equals("小明")){
                employee.setSalary(employee.getSalary()+300);
            }
            System.out.println(employee);
        }
    }

}
